package com.xjm.aop.targets;

import org.springframework.aop.framework.ProxyFactory;
import org.springframework.aop.target.SingletonTargetSource;

/**
 * @author jaymin
 * 2021/3/14 20:40
 */
public class TargetObjectDemo {
	public static void main(String[] args) {
		TargetObject targetObject = new TargetObject();
		SingletonTargetSource singletonTargetSource = new SingletonTargetSource(targetObject);
		TargetObject proxy = (TargetObject) ProxyFactory.getProxy(singletonTargetSource);
		System.out.println(proxy.getClass().getName());
		System.out.println("target object:"+singletonTargetSource.getTarget().getClass().getName());
	}
}
